<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <link rel="apple-touch-icon" href="/easyTracker/images/logo-medium.png"/>

</head>

<body>

<div id="fb-root"></div>
    <script type="text/javascript">
   	window.fbAsyncInit = function() {
   		//alert("111");
	    FB.init({
	      appId      : '176224242494571', // App ID
	  //    channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
	      status     : true, // check login status
	      cookie     : true, // enable cookies to allow the server to access the session
	      xfbml      : true  // parse XFBML
	    });
	    //alert("123");
	    FB.getLoginStatus(function(response) {
		      //alert(response.status);
			  if (response.status == 'connected') {
			    var uid = response.authResponse.userID;
			    var accessToken = response.authResponse.accessToken;
			    window.location = "main?uid=" + uid + "&token=" + accessToken;
			  } else if (response.status == 'not_authorized') {
				window.location = "/vendingMachine/userProcess/register";
			  } 
	    });
	  };
      
       (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));

</script> 
Login page
<fb:login-button 
	registration-url="register"
	on-login="window.location = 'main'" 
/><br>

account :<br> 
password :<br>
[login]<br>

</body>
</html>
